package johnkkk.com.gl3x;

import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.widget.FrameLayout;
import android.widget.ImageView;

import com.graphics.GLGraphics;
import com.graphics.GLRender;
import com.system.GLLog;

import johnkkk.com.system_k.Terrain;
import johnkkk.com.test.TestGLRender;

/**
 * @Author: clm
 * @Date: 2018-11-01
 */

public class TerrainTextureMarkTest extends Activity {
    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        TestGLRender glRender = new TestGLRender(this);
        glRender.setGLooper(new GLRender.IGLLooper() {
            @Override
            public void init() {

            }

            @Override
            public void glLooper(double exTime) {

            }
        });
        setContentView(R.layout.activity_terrain_texture_mark_test);
        GLGraphics.init(this, 3, glRender);
        FrameLayout fl = findViewById(R.id.activity_game_fl);
        fl.addView(GLGraphics.getGLSurfaceView());
        Terrain terrain = new Terrain("");
        Bitmap bitmap = terrain.getTerrainBitmap();
        GLLog.loge("bitmap == null?" + (bitmap == null));
        ((ImageView)findViewById(R.id.iv)).setImageBitmap(bitmap);
    }
}
